{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CART 和 决策树的超参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from sklearn import datasets\n",
    "\n",
    "X, y = datasets.make_moons(noise=0.25, random_state=666)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD8CAYAAAB+UHOxAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHEVJREFUeJzt3X2MXNV5x/Hvg+M0mzTyhtrhZe2tSWXR8lqTlaEQVQQn\n4SWx7BDiQv4AVYks2tC0SLXiKBK4+QcnlorqQpO6bRSQmhfnBcctTt0AiUhRSVljbEyIg0uI8EKA\nkNgJitUY++kfcxfPrufO3Llz5t5z7/19JOTZmWHv2bOz97n3Oc85x9wdERFpnpPKboCIiJRDAUBE\npKEUAEREGkoBQESkoRQAREQaSgFARKShFABERBpKAUBEpKGCBAAz+7yZvWhme1Nev9TMDpnZY8l/\nt4Q4roiI5Pe6QN/nC8AdwN1d3vM9d39fP990/vz5vnjx4gGaJSLSLDt37vyZuy/I8t4gAcDdHzSz\nxSG+V7vFixczOTkZ+tuKiNSWmf0k63uLHAO42Mz2mNm3zOzstDeZ2RozmzSzyZdeeqnA5omINEtR\nAeBRYNzdzwP+Htia9kZ33+zuE+4+sWBBprsYERHJoZAA4O6/dPdXksfbgblmNr+IY4uISGeFBAAz\nO9XMLHm8LDnuy0UcW0REOgsyCGxmXwIuBeab2QHgVmAugLt/DrgG+DMzexU4DFzr2ohARKRUoaqA\nruvx+h20ykRFRCQSoeYBSI1t3TXFxh37e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z9PHv8UOCXlfUX2YZY+KbPfsh774iQt8C0zO7uYpmVW9ucuqyj60MwWA0uB\n7896KYp+7NI+GLAPi9gSMlWg3cbe4e5TZvZW4Ntm9sPk6iOW9g1Vtza2f+HubmZpJV9D68OaehQY\nd/dXzOwqYCuwpOQ2VU0UfWhmvw18Hfgrd/9l0cfvpUf7Bu7DUgOAD77bGO4+lfz7opndQ+sWPsjJ\nK0D7hr4bWrc2mtkLZnaauz+f3Lq+mPI9htaHHWTpkzJ3ket57PY/RHffbmb/YGbz3T2W9WOi34Uv\nhj40s7m0Tq7/6u7f6PCWUvuxV/tC9GGlU0Bm9iYze/P0Y+A9QMeqg5KUvRvaNuCG5PENwAl3LSX0\nYZY+2QZcn1RhXAQcaktlDVvP9pnZqWZmyeNltP6OXi6ofVmU2X+ZlN2HybH/BXjS3f825W2l9WOW\n9gXpw6JGtXOMgr+fVs7t/4AXgB3J86cD25PHb6NVpbEbeIJWaiaa9vnxSoIf0aosKax9ybF/B7gf\neAq4Dzg5hj7s1CfAjcCNyWMD7kxef5wuVWAlte+mpK92Aw8DFxfcvi8BzwNHks/gh2Pqv4xtLLsP\n30Fr7GsP8Fjy31Wx9GPG9g3ch5oJLCLSUJVOAYmISH4KACIiDaUAICLSUAoAIiINpQAgItJQCgAi\nIg2lACAi0lAKACIiDfX/6sAIFLYfDt8AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1121331d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DecisionTreeClassifier(class_weight=None, criterion='gini', max_depth=None,\n",
       "            max_features=None, max_leaf_nodes=None,\n",
       "            min_impurity_decrease=0.0, min_impurity_split=None,\n",
       "            min_samples_leaf=1, min_samples_split=2,\n",
       "            min_weight_fraction_leaf=0.0, presort=False, random_state=None,\n",
       "            splitter='best')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.tree import DecisionTreeClassifier\n",
    "\n",
    "dt_clf = DecisionTreeClassifier()\n",
    "dt_clf.fit(X, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def plot_decision_boundary(model, axis):\n",
    "    \n",
    "    x0, x1 = np.meshgrid(\n",
    "        np.linspace(axis[0], axis[1], int((axis[1]-axis[0])*100)).reshape(-1, 1),\n",
    "        np.linspace(axis[2], axis[3], int((axis[3]-axis[2])*100)).reshape(-1, 1),\n",
    "    )\n",
    "    X_new = np.c_[x0.ravel(), x1.ravel()]\n",
    "\n",
    "    y_predict = model.predict(X_new)\n",
    "    zz = y_predict.reshape(x0.shape)\n",
    "\n",
    "    from matplotlib.colors import ListedColormap\n",
    "    custom_cmap = ListedColormap(['#EF9A9A','#FFF59D','#90CAF9'])\n",
    "    \n",
    "    plt.contourf(x0, x1, zz, linewidth=5, cmap=custom_cmap)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X+MHOWd5/H3d36QGZuxHWOMBxvj5LAt80OHDWKTmOQ4\nzkTYyorsiV2RHwqH9mSxuyHkoksukiWvFAldciuhEJIN59sjS0QUlPXuEucYB2G8OYh17AEOYBsH\nx7ABPAwZAudxG8YwP577o6uHnpn+Ud1VXfVU1eclWe6prul6prq7vlXf5/s8Zc45REREutJugIiI\n+EEBQUREAAUEEREJKCCIiAiggCAiIgEFBBERAWIKCGZ2r5mNmtnhOs9fY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2Acs9Wl/1to/wK3ArcFjo3xjpReBQzSoPEu5\nnV8M9t2zwBPAx1Jo44+BEWAi+Gz+qaf7slk7fdiXV1PuV3sOeCb4t823/RmynS3vT01dISIiQMZS\nRiIi0jkKa41tAAAAJklEQVQKCCIiAiggiIhIQAFBREQABQQREQkoIIiICKCAICIigf8PX+IZSwAK\n0uUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11283bba8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plot_decision_boundary(dt_clf, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHfxJREFUeJzt3X+MXeV95/H31zMTPLjXnjgGPNgQksW2IESNDaLZmK7Y\nrlNhqytvV65E9o+wKJVF2yTbjao2kleuFBUp2T/YbUla1tvSgrRKtHXbxFnGRTi0S+tduoDDDwPB\nMTQJMx1iAsIeYJzMj+/+MedO5sf9ce45557znHM+L8nynTvX9zw+M/f5nuf7fJ/nmLsjIiKypugG\niIhIGBQQREQEUEAQEZGIAoKIiAAKCCIiElFAEBERIKOAYGb3m9k5Mzvd5vu3mtl5M3s6+nM4i+OK\niEh2BjN6nz8Dvgw82OE1f+fuv5TR8UREJGOZjBDc/THgzSzeS0REipHVCCGOj5nZs8AE8Fvu/nyr\nF5nZQeAgwLpLLrlx2+bNOTZRROJ4Y/h9RTdB2nj1O6d+5O6XJfm3eQWEU8DV7v62me0Dvg5sa/VC\ndz8CHAHYec01/jeHDuXURBGJ64GP3FF0E6SN37z5ku8n/be5VBm5+wV3fz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ofOY9O95h1vyX\nWcjF/Rj4IfBw9PyVwFj0+IMsVHo8AzzPQgonuHb6TysRzrBQpVJEO98HfAv4LnAC2BjS+Wx1foC7\ngLuix8bCjZVeBp6jQ+VZwe38dHTungEeBz5WQBu/CkwCM9Hv5qcCPZfd2hnCubyFhXm1Z4Gnoz/7\nQjufMdvZ8/nU1hUiIgKULGUkIiL9o4AgIiKAAoKIiEQUEEREBFBAEBGRiAKCiIgACggiIhL5/5aa\n1P1rMqN1AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1124f1b00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf2 = DecisionTreeClassifier(max_depth=2)\n",
    "dt_clf2.fit(X, y)\n",
    "\n",
    "plot_decision_boundary(dt_clf2, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHhFJREFUeJzt3X+MXeV95/H31zOTeHDHTBwDHmwISbEtfkTFBtFsTFds\n1lTYauXtypXIahWKUlm0zY82WrWRLLlSJKRk/2A3IWlZb5cU1CioddvEKeMiHNol9S5dwOGHDYEY\nmoSZDjEB2R5gnMyP7/4x507uzNw799xzzj3nOed8XpLlO/ce3/P43Lnne57v832eY+6OiIjIqqIb\nICIiYVBAEBERQAFBREQiCggiIgIoIIiISEQBQUREgIwCgpndZ2anzexEm9dvNrOzZvZ09OdAFvsV\nEZHs9Gf0Pn8OfBl4YIVtvuPuv5bR/kREJGOZ9BDc/THgzSzeS0REipFVDyGOD5vZs8A48F/c/WSr\njcxsH7APYM2733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nxbCHO8QlhyZOObWj+Err7qJn9iZmtd/eQ\nFkAL4Vh2FMqxNLMB5k+yX3P3v2mxSRDHs1M7kxzPUqWMzGyNmQ01HgO/yvw9GUITwnIdh4Hbo8e3\nA8t6NgUezzjH5zDwsaii40PA2aYUWF46ttPMNpjNr/9uZjcy/516I+d2dhLCsewohGMZ7f9/AS+4\n+91tNiv8eMZpZ6Ljmffo+Aqj5r/BfC7up8CPgYej5y8FRqPHH2C+0uMZ4CTzKZzg2uk/r0R4ifkq\nlSLa+V7g28D3gaPAupCOZ6vjA9wJ3Bk9NuZvrPQy8BwrVJ4V3M5PRMfuGeBx4MMFtPHrwAQwHf1u\nfjzQY9mpnSEcy5uYH1d7Fng6+rM7tOMZs51dH08tXSEiIkDJUkYiItI7CggiIgIoIIiISEQBQURE\nAAUEERGJKCCIiAiggCAiIpH/DwUm2TY2Tmw4AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x113013400>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf3 = DecisionTreeClassifier(min_samples_split=10)\n",
    "dt_clf3.fit(X, y)\n",
    "\n",
    "plot_decision_boundary(dt_clf3, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHqRJREFUeJzt3X+MHOV5B/Dv472DW5u1D2PAh40hFNsyEDXGlkMwiWhq\nImwlclNRieSPUCuRRRpIoyRKkCw5UhSkpFJREpKGuikJSFVQ6ybglHOpHSeFuCEFO/wwdgBDA9zl\nwA7I9to+k/vx9I+dPfb29s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Oc9vg/AXyS8/078HJ+NAO7XmscB9IvIgMF2pk5VHwXwVoenWDiWftqZ\nOlUdUdX93uMqapWRzUvXpn48fbYzMDMBIQAFsFtE9nnLXFjUarmOpNdDvlBVR7zHrwO4sM3z0jie\nfo6PhWPotw3XeqmDnSJyZTJNC8TCsfTLzLEUkUsBrATw66ZfmTqeHdoJBDyeid4PwdEyGNep6rCI\nXABgl4j81rvycCbp5TrC6tTOxh9UVUWkXX1x7Mcz5/YDWKKqJ0VkA4AHASxNuU1ZZeZYisg5AP4d\nwOdU9UQabfCjSzsDH89EA4JGXwYDqjrs/X1ERH6CWrfe6QnMQTsTWa6jUztF5A0RGVDVEa87e6TN\na8R+PFvwc3wsLHnStQ2NX0JVHRSRfxCRBapqaQE0C8eyKyvHUkR6UTvJ/ouq/rjFU0wcz27tDHM8\nM5UyEpE5IlKpPwbwIdTuyWCNheU6dgC4xXt8C4AZPZsUj6ef47MDwCe8io5rABxvSIElpWs7RWSh\nSG39dxFZg9p36s2E29mNhWPZlYVj6e3/nwEcUtW72jwt9ePpp52hjmfSo+MdRs0/ilou7m0AbwB4\nxNt+EYBB7/FlqFV6PA3gOdRSOObaqe9UIryAWpVKGu08D8DPALwIYDeA+ZaOZ6vjA+BWALd6jwW1\nGyu9BOBZdKg8S7mdt3nH7mkAjwO4NoU2/gjACIAx77P5SaPHsls7LRzL61AbV3sGwFPenw3WjqfP\ndgY+nly6goiIAGQsZURERPFhQCAiIgAMCERE5GFAICIiAAwIRETkYUAgIiIADAhEROT5fxFE6vki\nWqXwAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x113013780>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf4 = DecisionTreeClassifier(min_samples_leaf=6)\n",
    "dt_clf4.fit(X, y)\n",
    "\n",
    "plot_decision_boundary(dt_clf4, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAD8CAYAAAB3u9PLAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHfxJREFUeJzt3X+MXeV95/H31zMTPLjXnjgGPNgQksW2IESNDaLZmK7Y\nrlNhqytvV65E9o+wKJVF2yTbjao2kleuFBUp2T/YbUla1tvSgrRKtHXbxFnGRTi0S+tduoDDDwPB\nMTQJMx1iAsIeYJzMj+/+MedO5sf9ce45557znHM+L8nynTvX9zw+M/f5nuf7fJ/nmLsjIiKypugG\niIhIGBQQREQEUEAQEZGIAoKIiAAKCCIiElFAEBERIKOAYGb3m9k5Mzvd5vu3mtl5M3s6+nM4i+OK\niEh2BjN6nz8Dvgw82OE1f+fuv5TR8UREJGOZjBDc/THgzSzeS0REipHVCCGOj5nZs8AE8Fvu/nyr\nF5nZQeAgwLpLLrlx2+bNOTZRROJ4Y/h9RTdB2nj1O6d+5O6XJfm3eQWEU8DV7v62me0Dvg5sa/VC\ndz8CHAHYec01/jeHDuXURBGJ64GP3FF0E6SN37z5ku8n/be5VBm5+wV3fzt6PAYMmdmmPI4tIiLx\n5BIQzGyzmVn0+ObouG/kcWwREYknk5SRmX0VuBXYZGbjwO8CQwDufh9wAPg1M5sFpoHbXdusiogE\nJZOA4O6f6PL9L7NQlioiIoHSSmUREQHyLTuVkhqbGubeNxu8NjvA5sE5PrNxin2N6aKbJSIZU0Co\nkH503GNTw3zh9Q1c9IXB5OTsIF94fQOAgoJIxShlVBHNjntydhDHFjvusanhVO9775uNxWDQdNHX\ncO+bjVTvKyLhUUCoiH513K/NDvT0vIiUlwJCRfSr4948ONfT8yJSXgoIFdGvjvszG6dYa/PLnltr\n83xm41Sq9xWR8CggVES/Ou59jWkOX3ae0cFZDGd0cJbDl53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fYB9w\nHDDgo8A/FPCzjtPOW4H/VcTv4pI2/AtgF3C6zfcLP5cx2xnCuRwFdkWPG8CZQH8347Sz5/MZzAjB\n3V9095eKbkc3Mdu5uF2Hu/8EaG7Xkaf9wAPR4weAf5Pz8TuJc372Aw/6gseBETMbDbCdhXP3x4A3\nO7wkhHMZp52Fc/dJdz8VPZ5ioTJy5da1hZ/PmO3sWTABoQcOnDCzp6JtLkLUaruOvPdDvsLdJ6PH\nrwFXtHldEeczzvkJ4RzGbcPHotTBcTP7UD5N60kI5zKuYM6lmV0D7AT+YcW3gjqfHdoJPZ7PXO+H\nkNE2GLe4+4SZXQ48Ymbfia48MpP3dh1JdWrn0i/c3c2sXX1x389nxZ0Crnb3t81sH/B1YFvBbSqr\nYM6lmf0M8BfAb7r7hSLaEEeXdvZ8PnMNCJ5+GwzcfSL6+5yZ/RULw/pMO7AM2pnLdh2d2mlmPzSz\nUXefjIaz59q8R9/PZwtxzk8IW550bcPSD6G7j5nZH5rZJncPaQO0EM5lV6GcSzMbYqGT/R/u/pct\nXhLE+ezWziTns1QpIzNbZ2aN5mPgF1m4J0NoQtiu4xhwR/T4DmDVyKbA8xnn/BwDPhlVdHwUOL8k\nBZaXru00s81mC/u/m9nNLHym3si5nd2EcC67CuFcRsf/E+BFd7+nzcsKP59x2pnofOY9O95h1vyX\nWcjF/Rj4IfBw9PyVwFj0+IMsVHo8AzzPQgonuHb6TysRzrBQpVJEO98HfAv4LnAC2BjS+Wx1foC7\ngLuix8bCjZVeBp6jQ+VZwe38dHTungEeBz5WQBu/CkwCM9Hv5qcCPZfd2hnCubyFhXm1Z4Gnoz/7\nQjufMdvZ8/nU1hUiIgKULGUkIiL9o4AgIiKAAoKIiEQUEEREBFBAEBGRiAKCiIgACggiIhL5/5aa\n1P1rMqN1AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x11321b518>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "dt_clf5 = DecisionTreeClassifier(max_leaf_nodes=4)\n",
    "dt_clf5.fit(X, y)\n",
    "\n",
    "plot_decision_boundary(dt_clf5, axis=[-1.5, 2.5, -1.0, 1.5])\n",
    "plt.scatter(X[y==0,0], X[y==0,1])\n",
    "plt.scatter(X[y==1,0], X[y==1,1])\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
